home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / manageme / tcpdump-.001 / tcpdump-~ / tcpdump-3.0.2-linux / linux-include / netinet / tcp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-30  |  1.3 KB  |  57 lines

  1. /*    @(#)tcp.h 1.11 88/08/19 SMI; from UCB 7.2 10/28/86    */
  2.  
  3. /*
  4.  * Copyright (c) 1982, 1986 Regents of the University of California.
  5.  * All rights reserved.  The Berkeley software License Agreement
  6.  * specifies the terms and conditions for redistribution.
  7.  */
  8.  
  9. #ifndef _netinet_tcp_h
  10. #define _netinet_tcp_h
  11.  
  12. typedef    u_long    tcp_seq;
  13. /*
  14.  * TCP header.
  15.  * Per RFC 793, September, 1981.
  16.  */
  17. struct tcphdr {
  18.     u_short    th_sport;        /* source port */
  19.     u_short    th_dport;        /* destination port */
  20.     tcp_seq    th_seq;            /* sequence number */
  21.     tcp_seq    th_ack;            /* acknowledgement number */
  22. #if defined(vax) || defined(i386)
  23.     u_char    th_x2:4,        /* (unused) */
  24.         th_off:4;        /* data offset */
  25. #endif
  26. #if defined(mc68000) || defined(sparc)
  27.     u_char    th_off:4,        /* data offset */
  28.         th_x2:4;        /* (unused) */
  29. #endif
  30.     u_char    th_flags;
  31. #define    TH_FIN    0x01
  32. #define    TH_SYN    0x02
  33. #define    TH_RST    0x04
  34. #define    TH_PUSH    0x08
  35. #define    TH_ACK    0x10
  36. #define    TH_URG    0x20
  37.     u_short    th_win;            /* window */
  38.     u_short    th_sum;            /* checksum */
  39.     u_short    th_urp;            /* urgent pointer */
  40. };
  41.  
  42. #define    TCPOPT_EOL    0
  43. #define    TCPOPT_NOP    1
  44. #define    TCPOPT_MAXSEG    2
  45.  
  46. /*
  47.  * Default maximum segment size for TCP.
  48.  * With an IP MSS of 576, this is 536,
  49.  * but 512 is probably more convenient.
  50.  */
  51. #ifdef    lint
  52. #define    TCP_MSS    536
  53. #else
  54. #define    TCP_MSS    MIN(512, IP_MSS - sizeof (struct tcpiphdr))
  55. #endif
  56. #endif /*!_netinet_tcp_h*/
  57.